package com.liang.design.visitor.impl;

import com.liang.design.user.User;
import com.liang.design.user.impl.Student;
import com.liang.design.user.impl.Teacher;
import com.liang.design.visitor.Visitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author lsm
 * @ClassName Principal.java
 * @Description 校长
 * @createTime 2023年12月06日 19:56:00
 */
public class Principal implements Visitor {

    Logger logger = LoggerFactory.getLogger(Principal.class);
    @Override
    public void visit(Student student) {
        logger.info("学⽣生信息 姓名： {} 班级： {}", student.getName(), student.getClazz());
    }

    @Override
    public void visit(Teacher teacher) {
        logger.info("学⽣生信息 姓名： {} 班级： {} 升学率： {}", teacher.getName(), teacher.getClazz(), teacher.entranceRatio());
    }
}
